/**
 * @title: MyRequestOriginParser
 * @projectName mscloud
 * @Description TODO
 * @Author
 * @Date 2022/2/16 14:27
 */
package com.atguigu.springcloud.cloudsentinelgatewaydevelop.sentinel;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.server.ServerWebExchange;

import java.util.function.Function;

@Slf4j
public class MyRequestOriginParser implements Function<ServerWebExchange, String> {

    @Override
    public String apply(ServerWebExchange serverWebExchange) {
        String address=serverWebExchange.getRequest().getRemoteAddress().getAddress().toString().substring(1);
        log.info(address);
        return address;
    }
}
